<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://www.ccut.edu.cn/saturn" prefix="saturn"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Map"%>
<%@page import="edu.ccut.saturn.component.SaturnData"%>
<html>
<head>
<%@ include file="/jsp/include/header/meta.jsp"%>
<%@ include file="/jsp/include/header/stylesheettag.jsp"%>
<%@ include file="/jsp/include/header/javascript.jsp"%>
<script language="javaScript">

function bundleInfo(key){
	insertOrganForm.action = "<%=request.getContextPath()%>/edu.ccut.saturn.manager.bundles.impl::/componentModule/action/QueryBundleInfoAction.action?key="+key;
	insertOrganForm.submit();
}
</script>
<title>bundles管理</title>
</head>

<body>
<% 
	List bundleList = (List) request.getAttribute("bundleList"); 
	List sysBundleList = new ArrayList(); 
	List appBundleList = new ArrayList(); 
	
	for(int i=0;i<bundleList.size();i++){
		SaturnData bundleInfo = (SaturnData)bundleList.get(i);
		String bundleFilePath = bundleInfo.getString("bundleFilePath");
		if(bundleFilePath != null && bundleFilePath.indexOf("\\plugins") != -1){
			appBundleList.add(bundleInfo);
		}else{
			sysBundleList.add(bundleInfo);
		}
	}
	request.setAttribute("sysBundleList",sysBundleList);
	request.setAttribute("appBundleList",appBundleList);
%>

	<saturn:formBeans name="insertOrganForm" title="应用bundles" action="${pageContext.request.contextPath}/edu.ccut.saturn.manager.bundles.impl::/action/InstallBundleAction.action" method="post">
	<td>
		<saturn:table id="appBundleList" value="${appBundleList}" 
			item="var" isCursor="true" isPagepilot="true" percount="5">
			<saturn:tableColumn title="名称">
						<a href="javascript:bundleInfo('<saturn:out value="${var.symbolicName}"/>')"><saturn:out value="${var.key}"/></a>
			</saturn:tableColumn>
			<saturn:tableColumn title="标识">
						<saturn:out value="${var.symbolicName}"/>
			</saturn:tableColumn>
			<saturn:tableColumn title="版本">
						<saturn:out value="${var.version}"/>
			</saturn:tableColumn>
	
		</saturn:table>
	</td>
	</saturn:formBeans>
</body>
</html>